Resource URL: /platform/<<version=1>>/snapshot/snapshots/<SID>

    Overview: This resource applies the standard collection item pattern to
              individual OneFS snapshots.  SID in the resource path is either
              the snapshot name (preferred) or snapshot ID.

     Methods: GET, PUT, DELETE

********************************************************************************

Method GET: Retrieve snapshot information.

       URL: GET /platform/<<version=1>>/snapshot/snapshots/<SID>

There are no query arguments for this method.

GET response body schema:
{
  "type": [
    {
      "additionalProperties": false, 
      "type": "object", 
      "description": "A list of errors that may be returned.", 
      "properties": {
        "errors": {
          "items": {
            "additionalProperties": false, 
            "type": "object", 
            "description": "An object describing a single error.", 
            "properties": {
              "field": {
                "type": "string", 
                "description": "The field with the error if applicable."
              }, 
              "message": {
                "type": "string", 
                "description": "The error message."
              }, 
              "code": {
                "type": "string", 
                "description": "The error code."
              }
            }
          }, 
          "type": "array"
        }
      }
    }, 
    {
      "additionalProperties": false, 
      "type": "object", 
      "properties": {
        "snapshots": {
          "minItems": 0, 
          "items": {
            "type": "object", 
            "properties": {
              "pct_reserve": {
                "required": true, 
                "type": "number", 
                "description": "Percentage of configured snapshot reserved used for storing this snapshot."
              }, 
              "shadow_bytes": {
                "required": true, 
                "type": "integer", 
                "description": "The amount of shadow bytes referred to by this snapshot.", 
                "maximum": 4294967295
              }, 
              "name": {
                "minLength": 0, 
                "required": true, 
                "type": [
                  "string", 
                  "null"
                ], 
                "description": "The user or system supplied snapshot name. This will be null for snapshots pending delete."
              }, 
              "created": {
                "required": true, 
                "minimum": 0, 
                "type": "integer", 
                "description": "The Unix Epoch time the snapshot was created.", 
                "maximum": 18446744073709551615
              }, 
              "target_name": {
                "minLength": 0, 
                "required": true, 
                "type": [
                  "string", 
                  "null"
                ], 
                "description": "The name of the snapshot pointed to if this is an alias."
              }, 
              "expires": {
                "required": true, 
                "type": [
                  "integer", 
                  "null"
                ], 
                "description": "The Unix Epoch time the snapshot will expire and be eligible for automatic deletion.", 
                "maximum": 4294967295
              }, 
              "target_id": {
                "required": true, 
                "type": [
                  "integer", 
                  "null"
                ], 
                "description": "The ID of the snapshot pointed to if this is an alias. 18446744073709551615 (max uint64) is returned for an alias to the live filesystem.", 
                "maximum": 18446744073709551615
              }, 
              "schedule": {
                "minLength": 0, 
                "required": true, 
                "type": [
                  "string", 
                  "null"
                ], 
                "description": "The name of the schedule used to create this snapshot, if applicable."
              }, 
              "alias": {
                "minLength": 0, 
                "required": false, 
                "type": [
                  "string", 
                  "null"
                ], 
                "description": "Alias name to create for this snapshot. If null, remove any alias."
              }, 
              "state": {
                "minLength": 0, 
                "enum": [
                  "active", 
                  "deleting"
                ], 
                "type": "string", 
                "description": "Snapshot state.", 
                "required": true
              }, 
              "has_locks": {
                "required": true, 
                "type": "boolean", 
                "description": "True if the snapshot has one or more locks present see, see the locks subresource of a snapshot for a list of locks."
              }, 
              "path": {
                "description": "The /ifs path snapshotted.", 
                "minLength": 4, 
                "required": true, 
                "pattern": "^\\/ifs", 
                "maxLength": 1024, 
                "type": [
                  "string", 
                  "null"
                ]
              }, 
              "pct_filesystem": {
                "required": true, 
                "type": "number", 
                "description": "Percentage of /ifs used for storing this snapshot."
              }, 
              "id": {
                "required": true, 
                "type": "integer", 
                "description": "The system ID given to the snapshot. This is useful for tracking the status of delete pending snapshots.", 
                "maximum": 4294967295
              }, 
              "size": {
                "required": true, 
                "minimum": 0, 
                "type": "integer", 
                "description": "The amount of storage in bytes used to store this snapshot.", 
                "maximum": 18446744073709551615
              }
            }
          }, 
          "type": "array", 
          "maxItems": 4294967295
        }
      }
    }
  ]
}

********************************************************************************

Method PUT: Modify snapshot. All input fields are optional, but one or more
            must be supplied.

       URL: PUT /platform/<<version=1>>/snapshot/snapshots/<SID>

There are no query arguments for this method.

PUT request body schema:
{
  "type": "object", 
  "properties": {
    "alias": {
      "minLength": 0, 
      "type": [
        "string", 
        "null"
      ], 
      "description": "Alias name to create for this snapshot. If null, remove any alias."
    }, 
    "expires": {
      "type": [
        "integer", 
        "null"
      ], 
      "description": "The Unix Epoch time the snapshot will expire and be eligible for automatic deletion.", 
      "maximum": 4294967295
    }, 
    "name": {
      "minLength": 0, 
      "type": [
        "string", 
        "null"
      ], 
      "description": "The user or system supplied snapshot name. This will be null for snapshots pending delete."
    }
  }
}

There is no JSON response body for this method.

********************************************************************************

Method DELETE: Delete the snapshot. Deleted snapshots will be placed into a
               deleting state until the system can reclaim the space used by
               the snapshot.

          URL: DELETE /platform/<<version=1>>/snapshot/snapshots/<SID>

There are no query arguments for this method.

There is no JSON response body for this method.
